package com.xudow.app.dynamicstate_old.module.user;

import android.content.Context;
import android.content.Intent;
import android.os.Bundle;
import android.view.View;
import android.widget.LinearLayout;

import com.jude.beam.expansion.BeamBaseActivity;
import com.umeng.message.PushAgent;
import com.umeng.message.UmengMessageHandler;
import com.umeng.message.entity.UMessage;
import com.xudow.app.R;
import com.xudow.app.dynamicstate_old.module.message.DynamicMsgActivity;
import com.xudow.app.dynamicstate_old.module.message.SystemMsgActivity;

import butterknife.BindView;
import butterknife.ButterKnife;
import butterknife.OnClick;

public class ConversationListActivity extends BeamBaseActivity {

    @BindView(R.id.ll_xudow_msg)
    LinearLayout llXudowMsg;
    @BindView(R.id.ll_dynamic_msg)
    LinearLayout llDynamicMsg;

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_conversationlist);
        ButterKnife.bind(this);

        setListener();
    }

    private void setListener() {
        findViewById(R.id.image_back).setOnClickListener(v -> finish());
        llXudowMsg.setOnClickListener(v -> startActivity(new Intent(this, SystemMsgActivity.class)));
        llDynamicMsg.setOnClickListener(v -> startActivity(new Intent(this, DynamicMsgActivity.class)));
    }

    private void registerUmengMessage() {
        PushAgent.getInstance(this).setMessageHandler(new UmengMessageHandler() {
            @Override
            public void dealWithNotificationMessage(Context context, UMessage uMessage) {
//                if (uMessage.extra.get("msgType"))
//                dynamicTopbarMsg.setImageResource(R.drawable.dynamic_message_new);
                super.dealWithNotificationMessage(context, uMessage);
            }

            @Override
            public void dealWithCustomMessage(Context context, UMessage uMessage) {
                super.dealWithCustomMessage(context, uMessage);
            }
        });
    }
}